/**************************************************************************************
*
*	Copyright (C) 2009 - 2012 Brent Andrew O. Chua - See LICENSE.txt for more info.
*		
*	Filename	-	ParameterBinderScalar.h
*
*	Description -	.
*
*	Comments	-
*
*	Modification History:
*			Name			   Date					Description
*			MrCodeSushi	-	06/10/2012	-	Creation of this file
**************************************************************************************/
#ifndef _PSX_PARAMETER_BINDER_SCALAR_H_
#define _PSX_PARAMETER_BINDER_SCALAR_H_

#include "PulseSTD.h"
#include "GraphicsTypes.h"
#include "IParameterBinder.h"

namespace Pulse
{
	class ParameterBinderScalar : public IParameterBinder
	{
	public:

		ParameterBinderScalar( void );

		ParameterBinderScalar( IParameter *pParam );

		virtual ~ParameterBinderScalar( void ) { }

		virtual void SetAsScalar( const BOOL val ) { m_bool = val; }

		virtual void SetAsScalar( const INT val ) { m_int = val; }

		virtual void SetAsScalar( const UINT val ) { m_uint = val; }

		virtual void SetAsScalar( const FLOAT val ) { m_float = val; }

		void SetData( const BOOL val ) { m_bool = val; }
		
		void SetData( const INT val ) { m_int = val; }
		
		void SetData( const UINT val ) { m_uint = val; }

		void SetData( const FLOAT val ) { m_float = val; }

		virtual void BindValue( void );

		virtual EParameter::Type GetType( void ) { return EParameter::SCALAR; }

	private:

		union
		{
			BYTE	m_data[4]; // Data copy/assignments assumes the size of 32 bytes
			BOOL	m_bool;
			INT		m_int;
			UINT	m_uint;
			FLOAT	m_float;
		};

	};
}

#endif /* _PSX_PARAMETER_BINDER_SCALAR_H_ */